package com.yxq.mdt.app.modules.main.prestener;


import com.yxq.mdt.app.base.BasePresenter;
import com.yxq.mdt.app.modules.main.bean.AppVersion;
import com.yxq.mdt.app.modules.main.bean.NameAndPhoneBean;
import com.yxq.mdt.app.modules.main.model.AppModel;
import com.yxq.mdt.app.net.ApiModel;

public class AppPresenter extends BasePresenter<IAppContract.View, AppModel> implements IAppContract.Presenter {

    public AppPresenter(IAppContract.View view, AppModel model) {
        super(view, model);
    }

    @Override
    public void getSzyVersion() {

        mBaseModel.getSzyVersion(new ApiModel.CommonCallback<AppVersion>() {
            @Override
            public void onSuccess(AppVersion appVersion) {
                mRootView.onLoadSuccess(appVersion);
            }

            @Override
            public void onError(String errMsg) {
                mRootView.onLoadFailed(errMsg);
            }
        });
    }

    public void getNameAndPhone() {

        mBaseModel.getNameAndPhone(new ApiModel.CommonCallback<NameAndPhoneBean>() {
            @Override
            public void onSuccess(NameAndPhoneBean nameAndPhoneBean) {
                mRootView.onLoadNameAndPhoneSuccess(nameAndPhoneBean);
            }

            @Override
            public void onError(String errMsg) {
                mRootView.onLoadNameAndPhoneFailed(errMsg);
            }
        });
    }
}
